<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<div clsss="box no-border">
	<div class="header">
		<h3>任务信息</h3>
	</div>
	<form:form id="taskForm" commandName="model" cssClass="validate"
		action="task/task/save">
		<form:hidden path="id" />
		<table class="form-table">
			<tbody>

				<tr>
					<td class="td1">任务名称：</td>
					<td class="td2"><form:input path="name" cssClass="required" />
					</td>
				</tr>

				<tr>
					<td class="td1">任务类别：</td>
					<td class="td2"><isperp:dictSelector typeCode="TASK_TYPE"
							name="taskType" id="taskType" hasEmptyValue="true"
							dictCssClass="required" selectedValue="${model.taskType }"></isperp:dictSelector>
					</td>
				</tr>

				<tr>
					<td class="td1">关联项目：</td>
					<td class="td2"><form:select path="projectId"
							items="${projects}" itemLabel="name" itemValue="id"
							cssClass="search required" />
					</td>
				</tr>
				<tr>
					<td class="td1">项目阶段：</td>
					<td class="td2"><form:radiobuttons path="projectStage"
							items="${projectStages}" itemLabel="name" itemValue="name" /></td>
				</tr>
				<tr>
					<td class="td1">优先级：</td>
					<td class="td2"><form:radiobuttons path="priority"
							items="${taskPrioirties}" itemLabel="name" itemValue="name" /></td>
				</tr>
				<tr>
					<td class="td1">负责人：</td>
					<td class="td2"><form:hidden path="planPrincipalId" /> <isperp:departmentUser
							id="planPrincipalIdSelector"
							displayValue="${model.planPrincipalName }"
							valueControlId="planPrincipalId" name="planPrincipalName"></isperp:departmentUser>
					</td>
				</tr>

				<tr>
					<td class="td1">计划执行时间：</td>
					<td class="td2"><input name="planStartTime" type="datetime"
						value="<fmt:formatDate value="${model.planStartTime}"
						pattern="yyyy-MM-dd mm:hh" />" />~<input
						name="planEndTime" type="datetime"
						value="<fmt:formatDate value="${model.planEndTime}"
						pattern="yyyy-MM-dd mm:hh" />" />
					</td>
				</tr>
				<tr>
					<td class="td1">计划工时(h)：</td>
					<td class="td2"><form:input path="planTimes" maxlength="10"
							cssClass="required" cssStyle="width:60%" /></td>
				</tr>
				<tr>
					<td class="td1">任务目标：</td>
					<td class="td2"><form:textarea path="target"
							cssClass="required" />
					</td>
				</tr>
				<tr>
					<td class="td1">任务内容：</td>
					<td class="td2"><form:textarea path="content"
							cssClass="required" /></td>
				</tr>
				<tr>
					<td class="td1">交付标准：</td>
					<td class="td2"><form:textarea path="deliverables"
							cssClass="required" /></td>
				</tr>
				 
			</tbody>
		</table>
	</form:form>
</div>

<isperp:buttonList>
	<isperp:processButtons businessKey="${model.id }" formId="taskForm"
		processKey="taskProcess" processId="${model.processId }"
		beforeSubmit=" function(){return check();}"></isperp:processButtons>
</isperp:buttonList>

<script type="text/javascript">
	function check() {
		var rowData = $("#categoryCiGrid").jqGrid("getRowData");
		if (rowData.length == 0 && $("#taskType").val() == "资产审计") {
			isperp.errorAlert("请添加需要审计的资产！");
			return false;
		} else {
			return true;
		}
	}
</script>
